Subscription to document actors

This type of subscription must be used if you want to update a single or multiple fields of the document based on a VDoc type field.

Here is a subscription definition example based on document actors.

<subscription name="onChange" field-id="Utilisateur" subscription-class="com.axemble.vdp.mapping.extensions.ActorsMappingExtension">
        <on-stage name="Tache"/>
        <action field-id="ManagerRole" action-key="@toHierarchicalManager(Utilisateur)"/>
        <action field-id="HierarchicalManagerRole" action-key="@toManager(Utilisateur)"/>
        <action field-id="AssistantRole" action-key="@toAssistant(Utilisateur)"/>
        <action field-id="Role" action-key="@toRole(Utilisateur)"/>
</subscription>

The previous example shows you how to achieve subscriptions that permits you to recover directory information,particularly the hierarchical superior, the superior or even the assistant. It shows you how to allocate a role to a user field.

This second example shows you how to allocate a role from a users list:

<subscription name="onChange" field-id="ListeDePersonnes" subscription-class="com.axemble.vdp.mapping.extensions.ActorsMappingExtension">
        <on-stage name="Tache"/>
        <action field-id="Role" action-key="@toRole(ListeDePersonnes)"/>
</subscription> 

subscription

The "subscription" element defines the subscription input in the resource template XML.

Element Description Where to find more information?
field-id Modified document field and trigger of the "onChange" event.
name Name of occurred event
prop-id Not available
subscription-class Extension class: “com.axemble.vdp.mapping.extensions.ResourceBrowserMappingExtension”

on-stage

The "on-stage" element defines the input of a step on which the subscription will be run.

Element Description Where to find more information?
name System name of the concerned step The keyword « <<sys_CreationWizard »enables to indicate that the treatment will be processed only on the action of process>> document creation.

action

The "action" element defines the input of an action to be performed after an event is triggered.

Element Description Where to find more information?
field-id System name of the subscribed field
prop-id Not active
action-key Property of trigger object obtained by introspection

The actions

Actions define all the document fields that will be updated when subscription is run. Actions can only be defined at the XML document level of the resource template. It is possible to define 1 to n actions.

The filters

Filters on steps can be placed to restrict subscriptions running on some steps. If no step has been specified, the subscription will be valid at all steps of the document. Filters are defined at the XML document level of the resource template. The on-stage tags can be present from 0 to n times.

Introspection

Introspection will let you access the object's intrinsic properties. These properties should be accessible through the "get" type methods. Introspection is possible at the "action-key" attribute level of the "action" tag.

Functions

Function Parameters Concerned classes Description
@toHierarchicalManager(field_name) Field name User or DirectoryElement Allocation of a role with a user's superior.
@toManager(field_name) Field name User or DirectoryElement Allocation of a role with a user's superior.
@toAssistant(field_name) Field name User or DirectoryElement Allocation of a role with a user's assistant.
@toRole(field_name) Field name Collection of users DirectoryElement Allocation of a role with a user or a list of users.